package cn.wangsy.zhidao.p20170111;

public class Prime {

	public static void main(String[]args){
	    int [][] numbers = {
	        {7,12,4,9,6,3,9},
	        {2,6,3,54,2,56,21,33}
	    };        
	    for(int i=0;i<numbers.length;i++){
	        for(int j=0;j<numbers[i].length;j++){
	            if(isPrime(numbers[i][j])){
	                System.out.println(numbers[i][j]);
	            }
	        }
	    }
	}
	 
	public static boolean isPrime(int n){
	    for(int i=2;i<n;i++){
	        if(n%i==0){
	            return false;
	        }
	    }
	    if(n==1){
	        return false;
	    }
	    return true;
	}
	
}
